<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NBooks.Core.Models" assembly="NBooks.Core">
	<class name="PhysicalCount" table="physical_counts">
		<id name="Id" column="id">
			<generator class="identity" />
		</id>
		<property name="Date" column="date" />
		<property name="PreparedBy" column="prepared_by" />
		<property name="ApprovedBy" column="approved_by" />
		<property name="Remarks" column="remarks" />
		<bag name="Items" inverse="true" cascade="all-delete-orphan">
			<key column="physical_count_id" />
			<one-to-many class="PhysicalCountItem" />
		</bag>
	</class>
	<class name="PhysicalCountItem" table="physical_counts_items">
		<id name="Id" column="id">
			<generator class="identity" />
		</id>
		<many-to-one name="Count" class="PhysicalCount" column="physical_count_id" />
		<many-to-one name="Item" class="Item" column="item_id" />
		<property name="OriginalQty" column="original_qty" />
		<property name="AdjustedQty" column="adjusted_qty" />
	</class>
</hibernate-mapping>